<?php 
session_start(); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	
	<title>::FarmaSocial::</title>
	
    <style type="text/css" media="all">
		@import url("css/style.css");
		@import url("css/jquery.wysiwyg.css");
		@import url("css/facebox.css");
		@import url("css/visualize.css");
		@import url("css/date_input.css");
    </style>
	
	<!--[if lt IE 8]><style type="text/css" media="all">@import url("css/ie.css");</style><![endif]-->

</head>




<body>
	
	<div id="hld">
	  <div class="wrapper">		<!-- wrapper begins -->
		<div class="block small center login">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2>Login</h2>
					<ul>
						<li><a href="#">back to the site</a></li>
					</ul>
				</div>		<!-- .block_head ends -->
				<div class="block_content">
					<?php 
                    if($_REQUEST['error']=='501')
                    {	
                    ?>
                    <div class="message info"><p>Clave o usuario incorrecto.</p></div>
                    <?php }?>
                      <?php 
                    if($_REQUEST['error']=='502')
                    {	
                    ?>
                    <div class="message info"><p>Ha intentado ingresar de manera equivocada.</p></div>
                    <?php }?>
                       <?php 
                    if($_REQUEST['error']=='503')
                    {	
                    ?>
                    <div class="message info"><p>Ha ingresado mal la imagen.</p></div>
                    <?php }?>
					
					<form action="captcha.php" id="formulario" method="post">
						<p>
							<label>Usuario:</label> <br />
							<input type="text" class="text obt fl" name="login" id="login" />
						</p>
						
						<p>
							<label>Clave:</label> <br />
							<input type="password" class="text obt fl" name="clave" id="clave"  />
						</p>
                        <p>
							<label>Ingrese la Imagen:</label> <br />
							<span><input type="text" name="ccpt" id="ccpt" class="input-text obt fl"  style="width:125px"/></span>
                        	<span>
                            	<img src="clases/captcha.class.php" alt="captcha" style="margin-top:10px;" title="captcha" />
                            </span>
						</p>
						
						<p>
							<input type="submit" class="submit" value="Ingresar" id="form" /> &nbsp; 
							<input type="checkbox" class="checkbox" checked="checked" id="rememberme" /> <label for="rememberme">Recordarme</label>
						</p>
                        
					</form>
					
				</div>		<!-- .block_content ends -->
					
				<div class="bendl"></div>
				<div class="bendr"></div>
								
			</div>		<!-- .login ends -->
		  </div>						<!-- wrapper ends -->
		</div>		<!-- #hld ends -->
	<!--[if IE]><script type="text/javascript" src="js/excanvas.js"></script><![endif]-->	
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/jquery.img.preload.js"></script>
	<script type="text/javascript" src="js/jquery.filestyle.mini.js"></script>
	<script type="text/javascript" src="js/jquery.wysiwyg.js"></script>
	<script type="text/javascript" src="js/jquery.date_input.pack.js"></script>
	<script type="text/javascript" src="js/facebox.js"></script>
	<script type="text/javascript" src="js/jquery.visualize.js"></script>
	<script type="text/javascript" src="js/jquery.visualize.tooltip.js"></script>
	<script type="text/javascript" src="js/jquery.select_skin.js"></script>
	<script type="text/javascript" src="js/jquery.tablesorter.min.js"></script>
	<script type="text/javascript" src="js/ajaxupload.js"></script>
	<script type="text/javascript" src="js/jquery.pngfix.js"></script>
	<script type="text/javascript" src="js/custom.js"></script>
	<script>
    $(function(){
        function val_cmp(valor){
            if(valor.val() != '' && valor.val() != 'Este campo es requerido'){
                valor.css('color', '#666');
                return true;
            }else{
                valor.css('color', '#990000');
                valor.val('Este campo es requerido');
                return false;
            }
        }
        
        $('.obt').focus(function(){
            var valor = $(this).val();
            if(valor == 'Este campo es requerido' || valor == 'Formato de correo invalido'){
                $(this).val('');
            }
        });
        
        $('.obt').blur(function(){
            var valor = $(this).val(), nomcamp = $(this).attr('name');
            if(valor == ''){
                $(this).css('color', '#990000');
                $(this).val('Este campo es requerido');
            }else{
                $(this).css('color', '#666');
            }
        });
        
        $("#form").click(function(){
            var valido = true;
            $(".obt").each(function(){
                val_cmp($(this));
                valido = valido && val_cmp($(this));
            });
            
            if(valido)
            {
                return true;
            }else{
                return false;
            }
        });
        $("#brr").click(function(){
            $(".fl").val('');
        });
    });
    
    </script>
	
</body>
</html>